<template>
	<div class="g-icon01"
		@click="orderFun"
	>
		<span>{{ title }}</span>
		<span 
			class="icons"
		>
			<i :class="['icon iconfont icon-retract',{'active': state1 == 1 }]"></i>
			<i :class="['icon iconfont icon-spread',{'active': state1 == 2 }]"></i>
		</span>
	</div>
</template>

<script>
	export default {
		name: "gIcon01",
		data() {
			return {
				state1: 0
			}
		},
		props: {
			title: {
				type: String,
				default: function() {
					return '涨幅';
				},
				required: false
			}
		},
		methods: {
			orderFun() {
				this.state1++;
				if(this.state1 > 2){
					this.state1 = 0;
				}
				this.$emit('orderFun',this.state1);
			}
		}
	}
</script>
